<?php
namespace Admin\Controller;
use Think\Controller;
class IndexController extends CommonController{
    public function index(){
    	$this -> display();
	}
	public function left(){
		$this -> display();
	}
	public function right(){
		$act = I('act');
		if($act == 'admin'){
			$dir = C('DEL_ADMIN_RUNTIME');
			if(deldir($dir)){
				echo "<script> alert('后台缓存删除成功');</script>";
			}else{
				echo "<script> alert('缓存已删除，请稍后操作！');</script>";
			}
		}elseif($act == 'index'){
			$dir = C('DEL_INDEX_RUNTIME');
			if(deldir($dir)){
				echo "<script> alert('前缓存删除成功');</script>";
			}else{
				echo "<script> alert('缓存已删除，请稍后操作！');</script>";
			}
		}elseif($act == 'mysqlbackup'){
			$mysql = MySqlBackup();
			if($mysql){
				echo "<script> alert('MySql备份成功');</script>";
			}else{
				echo "<script> alert('MySql备份失败');</script>";
			}
		}elseif($act == 'mysqlupload'){
			MySqlUpload();
			echo "<script> alert('MySql上传成功');window.location.href='".U('Index/right')."';</script>";
		}
		
		$this -> display();
	}
	public function top(){
		$this -> display();
	}
}